<?php 

	function getTime(){
		static $teste = 0, $tempo;
		if( $teste%2 == 0 ){
			$tempo = microtime(true);
			$teste++;
		}
		else{
			echo 'Tempo (segundos): '.(microtime(true)-$tempo);
			$teste = 0;
		}
	}

	function pick(){
		$args = func_get_args();
		foreach($args as $arg){
			if(isset($arg)) return $arg;
		}
		return NULL;
	}

	function getVars(){
		$globalArrays = func_get_args();
		foreach($globalArrays as $vars){
			foreach($vars as $var => $value){
				global $$var;
				$$var = $value;
			}
		}
		return NULL;
	}

	function getLocalNames(){
		// get weekdays using locale
		for($i=1; $i<=7; $i++){
			$nWeek_weekName = explode('-',strftime("%w-%a", mktime(0, 0, 0, 1, $i, 2000)));// could be any month and/or year
			$weekDays[(int)$nWeek_weekName[0]] = $nWeek_weekName[1];
		}
		// get month days using locale
		for($i=0; $i<12; $i++){
			$monthNamesAbbrs = explode('-',strftime("%b-%B", mktime(0, 0, 0, $i+1, 1, 2000)));// could be any year
			$monthAbbrs[$i] = $monthNamesAbbrs[0];
			$monthNames[$i] = $monthNamesAbbrs[1];
		}
		return array('weekDays'=> $weekDays, 'monthAbbrs'=> $monthAbbrs, 'monthNames'=> $monthNames);
	}
?>